package com.jufa_3.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private CheckTokenInterceptor checkTokenInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(checkTokenInterceptor)
                //  .excludePathPatterns("/**");
                .excludePathPatterns(
                        "/user/login",          //启动请求获取token
                        "/user/getChec",
                        "/combo/getCostItems",
                        "/combo/getAllComboInfo",
                        "/comboOrder/getShareMonly",
                        "/costItem/getCostItems",
                        "/costItem/getDirectPayInfo",
                        "/costItem/getMinCost",
                        "/index/getTop20CaseInfo",
                        "/pay/callback",
                        "/user/sendVerifyCode",
                        "/user/verifyCodeRegister",
                        "/user/getUserCount")   //放开的请求
                .addPathPatterns(
                        "/cr/***",
                        "/combo/updataCostItem",
                        "/comboOrder/getYueCombo",
                        "/comboOrder/getTopUpRecords",
                        "/costItem/updataCostItem",
                        "/costItem/getComboCostInfo",
                        "/getPDF/***",
                        "/index/getUserOpinions",
                        "/index/updataOpinion",
                        "/index/addUserOpinion",
                        "/monitoringTask/updata",
                        "/monitoringTask/addMonitoring",
                        "/monitoringTask/getMonitoringList",
                        "/monitoringTask/getMonitorInfo",
                        "/pay/placeAnOrder",
                        "/pay-order/getPayRecords",
                        "/select/***",
                        "/user/getPullUser",
                        "/user/getContect",
                        "/user/weichatRegister");   //拦截的请求
    }
}
